{include file='common/head' /}
  <body>
    <div class="layui-fluid">
        <div class="layui-row">
            <form action="" method="post" class="layui-form layui-form-pane">
                <input type="hidden" name="id" value="{$id}">
                <div class="layui-form-item layui-form-text">
                    <label for="reply" class="layui-form-label">
                        回复内容
                    </label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" id="reply" name="reply" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="add">确定保存</button>
              </div>
            </form>
        </div>
    </div>
    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;

          //监听提交
          form.on('submit(add)', function(data){
              $.ajax({
                  url:"{:url('Videos/reply')}",
                  type: "post",
                  data:data.field,
                  dataType:"json",
                  success:function (res) {
                      if(res.code == 200){
                          layer.alert(res.msg, {icon: 1},function () {
                              //关闭当前frame
                              xadmin.close();
                              // 可以对父窗口进行刷新
                              xadmin.father_reload();
                          });
                      }else{
                          layer.alert(res.msg, {icon:2,time:1000});
                      }
                  },
                  error:function(e){
                      layer.alert("网络错误", {icon:5,time:1000});
                  },
              });
            return false;
          });
        });
    </script>
{include file='common/footer' /}